﻿@using ModelToDto
@using Commonality

@model UserRoleDTO

<h2>给 @Model.UserName 分配角色</h2>
<div class="div-table">
    <br />
    @using (Html.BeginForm("AssignRolesAdd", "User", FormMethod.Post, new { @class = "row g-3" }))
    {
        <div class="row mb-3">
            @Html.HiddenFor(c => c.UserID)
            @foreach (var ch in Model.selectListItems)
            {
                <label class="label label-default">@ch.Text</label>
                <div class="col-md-1">
                    @Html.CheckBox($"roleId_{ch.Value}", ch.Selected)
                </div>
            }
        </div>
        <div class="col-12">
            <button type="submit" class="btn btn-primary">提交</button>
        </div>
    }
</div>



